<!-- <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">  
            <Child>{{title}}</Child>
            <Child></Child>
    </div>
    <script src="./js/vue.js"></script>
    <script id="child"  type="text/x-template">
        <div>
            <h1>李雨航</h1>
            
           <slot>nihao </slot>
        </div>
    </script>

    <script>

        const Child={
            template:"#child",
            data(){
                return { num :100 }
            }
        }



        const app = new Vue({
            el: '#app',
            data:{
                title:"aaaa"
            },
            components:{Child},
            methods:{

            }

        })
    </script>
</body>
</html> -->



<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <Child>
            <h1 slot="header">我是一个头部</h1>
            <div>你好</div>
            <h4 slot="footer">底部声明</h4>
        </Child>
    </div>
    <script src="./js/vue.js"></script>
    <script id="child" type="text/x-template">
        <div>
            <slot name="footer">头部</slot>
            <h3>插槽</h3>
            <!-- 匿名插槽 默认使用它 -->
            <slot></slot>
            <slot name="header">底部</slot>
        </div>
    </script>

    <script>

        const Child = {
            template: "#child",
        }
        const app = new Vue({
            el: '#app',
            data: {
            },
            components: { Child },
            methods: {

            }

        })
    </script>
</body>

</html>